UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kbDIsf2wlmuBNs/nAyFiqcAb9ihB8eq/vCJURcV5gg='
WHERE
key_id = '56322e8e106df8ec3236d0d164801cca16bd58f6f8081fd1306c129f0c89c881'
AND (
token = '0kbDIsf2wlmuBNs/nAyFiqcAb9ihB8eq/vCJURcV5gg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)