UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oSe63tr6+hkoq6eUYKTXIVvNKWm5b2aENmjWVvFSL7o='
WHERE
key_id = '7d85a8673dbe1c9208c5335caffa6ee4ea65f4a20a7ae704ab675b703f7f8370'
AND (
token = 'oSe63tr6+hkoq6eUYKTXIVvNKWm5b2aENmjWVvFSL7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)