UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/B6XWVAOIUofSduq/OgpHRGsO7pgZvIZQzDyt1VRFWw=' 
WHERE 
  key_id = '030d0b55bf57950a438a347513be92b84bcb74d5c6f486d93ad033aeff1cdb51' 
  AND (
    token = '/B6XWVAOIUofSduq/OgpHRGsO7pgZvIZQzDyt1VRFWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050