UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7IIT1eJAvsMCKg5z3mvRilMiLr/gBh1ut6bUtRPiz4='
WHERE
key_id = 'c20368b8755a94f73b146fbc6ed51a9ac20fedd1c061939dc7eb0f26a2552c23'
AND (
token = 'A7IIT1eJAvsMCKg5z3mvRilMiLr/gBh1ut6bUtRPiz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)