UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vSkcwecaoXM8XSyC0rCTbR6ISt0OLaqzVf8cg6cEWI0=' 
WHERE 
  key_id = '02b3a5df99066be744c3ddfd50b223a01208f566da9304bba799720a5876a447' 
  AND (
    token = 'vSkcwecaoXM8XSyC0rCTbR6ISt0OLaqzVf8cg6cEWI0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021