UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OjUBvmSZ9XR3LGDh+2B4VvStp9iQ3If29FaKtWgbKwc=' 
WHERE 
  key_id = '0cdf31eb496c6cebd4ad01917f34b02eccfed6eec7b0aa60ba2a8a908967867e' 
  AND (
    token = 'OjUBvmSZ9XR3LGDh+2B4VvStp9iQ3If29FaKtWgbKwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042