UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6nt8Xtrzwv0P1o8pPCLS2rYWX/tqVJJnqN1ruTVpZTw='
WHERE
key_id = '84a16e23dc6181bc6b8488ffd6c436ce547a0171ed76d9bb52096fc79d157e60'
AND (
token = '6nt8Xtrzwv0P1o8pPCLS2rYWX/tqVJJnqN1ruTVpZTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)