UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QqTlpuF4LFulqOIIWE4PsTqq7rbV9ki36IyoOe1+/jE='
WHERE
key_id = '114398a3d515d529fd59840478689ad3fdc954289c25319255ca1e50640fe900'
AND (
token = 'QqTlpuF4LFulqOIIWE4PsTqq7rbV9ki36IyoOe1+/jE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)