UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3iLvTQizd4ZRweDec59JgaiqpaHVZgOoZexC9BJmMI8='
WHERE
key_id = 'eea69f48359265a9d076bdfd6fc54aadcfa26c6f7eb432423ee1729f5a36e843'
AND (
token = '3iLvTQizd4ZRweDec59JgaiqpaHVZgOoZexC9BJmMI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)