UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YOnA1Gh3BcplDEBMP6NQ3sY5ZSfVV5oZ0IE7/pavaCU=' 
WHERE 
  key_id = '8c4a8636e13e098cc00f17040964d92959f232970a354c3faca88e5847d01c24' 
  AND (
    token = 'YOnA1Gh3BcplDEBMP6NQ3sY5ZSfVV5oZ0IE7/pavaCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038