UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WlYvrUxpyvP8ir72RM4zJHuoGAmHTo33kzBhx2Yoqdo=' 
WHERE 
  key_id = 'f3273ac9a2f6935ea057fb0bec9cb18f4be5e84a4430dce98b68b83a816d697d' 
  AND (
    token = 'WlYvrUxpyvP8ir72RM4zJHuoGAmHTo33kzBhx2Yoqdo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024