UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fQ+xpUUWnI8ODcpnPcfMErmOjEfJMCEbRLMxzWaLS2Y=' 
WHERE 
  key_id = 'dbad8e8f0eb2b8d37997dda5cf65009bf6245baf89e4eea84b67c432987362f4' 
  AND (
    token = 'fQ+xpUUWnI8ODcpnPcfMErmOjEfJMCEbRLMxzWaLS2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027