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

Query time 0.00049