UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+vnAGeMuKST4XpuXInQut5+2WRABXy/deQ/gDjOgfCI=' 
WHERE 
  key_id = 'aa73d61259843c68bb960b96970f25e924f28adb1ccbcfebc6e62d57e22fc987' 
  AND (
    token = '+vnAGeMuKST4XpuXInQut5+2WRABXy/deQ/gDjOgfCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041