UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '99bp6DmhTWj2sAM4/TkTGhMJo0x7Qne9xioORKbf4fc='
WHERE
key_id = 'bb2cb5421f5243ceaa608f7360b8a54445a72e8ad759fcf78028ec518de227ad'
AND (
token = '99bp6DmhTWj2sAM4/TkTGhMJo0x7Qne9xioORKbf4fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)