UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5zaPULSiduuGN55R4uULq7PvwQ6R7sHdAqTXXiOpUBg='
WHERE
key_id = 'f7abd661de361c50da039a4dcaf7c940e4f14c6de603997280119a1b6cbc355d'
AND (
token = '5zaPULSiduuGN55R4uULq7PvwQ6R7sHdAqTXXiOpUBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)