UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P/G8EKxHv01Asdszsz3EW9FeN4PekGD2ZrHTMhHmepI=' 
WHERE 
  key_id = '9434015b468b5e45ec1fdd3a34b9a393f58edc6986c951383548eea3999484b9' 
  AND (
    token = 'P/G8EKxHv01Asdszsz3EW9FeN4PekGD2ZrHTMhHmepI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035