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

Query time 0.00029