UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TCTU2mVAnU7Pe6KiocB1uUgZ8TyP8aW1WHRKg/3CNY='
WHERE
key_id = '7b52ce9a42db3fddbd53eabad9fe217c280b4acc8d8dd63cb210f1128640fd9d'
AND (
token = '2TCTU2mVAnU7Pe6KiocB1uUgZ8TyP8aW1WHRKg/3CNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)