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