UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZlquKYua6LfbY1Sl/owwV1BTISbrHiuijKoP9dGeUw='
WHERE
key_id = 'e4cab309daba5f28c4b176f13789a17101749cf9d6e23edeaf6c954bbde32f33'
AND (
token = 'LZlquKYua6LfbY1Sl/owwV1BTISbrHiuijKoP9dGeUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)