UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ErruEb10FoHYzJ/cvWA0qF8Tmadw7aY8Y1vV5eljZ6U=' 
WHERE 
  key_id = 'bb288cfc59a166687add75af042e592c4a32c6abcbee85e762119569df8ddb70' 
  AND (
    token = 'ErruEb10FoHYzJ/cvWA0qF8Tmadw7aY8Y1vV5eljZ6U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052