UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i4ARAd5GF6AS/6Chlws6f47NIbtJyCqR7CX4H0+YoMo=' 
WHERE 
  key_id = '71ee63d086af5dcb848f41622c85bf1b7a48e4be869573fb45d8aaacef68f1ec' 
  AND (
    token = 'i4ARAd5GF6AS/6Chlws6f47NIbtJyCqR7CX4H0+YoMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039