UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5CHXrN1sihypaB6OP++W/klqjGyvDI7UIqCSRhM8kY8='
WHERE
key_id = '241021b0b8dee64407b9ce98d52aa3aca4e52ec1720a2c81cb3792a517eb9514'
AND (
token = '5CHXrN1sihypaB6OP++W/klqjGyvDI7UIqCSRhM8kY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)