UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MqtD7FRQpZqLCCWO/2qybuwA1dti37+USEGrwcwq3FI=' 
WHERE 
  key_id = '7760b91830f0a415c88a1ebd95ffba499dea37bd2825a2234951a2b68d0bd06d' 
  AND (
    token = 'MqtD7FRQpZqLCCWO/2qybuwA1dti37+USEGrwcwq3FI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035