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

Query time 0.00041