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