UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PrPzyA3PAFyK5ZaQWo3t1jXBgu/52luoCTuzPiQzggM='
WHERE
key_id = 'ffc4061fd99aebe0714917758594ec260ab1064aa67298c0875f8572ab4c1e6a'
AND (
token = 'PrPzyA3PAFyK5ZaQWo3t1jXBgu/52luoCTuzPiQzggM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)