UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PCEE6rAMs0ok9xfwavt2HLLLdoeX8ZAodUmSVoTuvGg=' 
WHERE 
  key_id = '73bd2e00d91bf4dcc849091eb7f784ce65cfe3c084333a6676f032d06637c5c8' 
  AND (
    token = 'PCEE6rAMs0ok9xfwavt2HLLLdoeX8ZAodUmSVoTuvGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028