UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VtI+g07hxks0Envf5s0XNIGbjROQx2emxtRXMLOcnsk=' 
WHERE 
  key_id = '813570edc13f44853fe5975ef32d4c24b7da5713a32d5e06deb3ccd1c16bf4a8' 
  AND (
    token = 'VtI+g07hxks0Envf5s0XNIGbjROQx2emxtRXMLOcnsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049