UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EbrHvQH4qlL7oH/o4fF7FG27a9Cb6cR7XV0Pg0/6f2U='
WHERE
key_id = '1870c12408c873df3fafdd3967f798b720d0d8f8322f21fd04da96f5fd1a4da2'
AND (
token = 'EbrHvQH4qlL7oH/o4fF7FG27a9Cb6cR7XV0Pg0/6f2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)