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

Query time 0.00031