UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q/N1ygng3znCAH4+OdalrmJxLH80aRuP2mCh2X7E9Q0='
WHERE
key_id = '721e4c2c6d68a8eaa4e42e24cf3d6b19858224a1758fe898d7ef6130485829bc'
AND (
token = 'Q/N1ygng3znCAH4+OdalrmJxLH80aRuP2mCh2X7E9Q0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)