UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ezhXhB1uI9g4f2l7O4oO0GAz88OPzCsbzRN8vwckzcU='
WHERE
key_id = 'fae44d0426a6dc08e54acb85cae7713ae0737a88d43cfe4293fdd5b3eb13795d'
AND (
token = 'ezhXhB1uI9g4f2l7O4oO0GAz88OPzCsbzRN8vwckzcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)