UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rorKTO7pl3WXnBAqdW/y/2VBFrRIB/yKhnMSW7waM6I=' 
WHERE 
  key_id = 'a0f113b3710373f3aceeac061bc858a801035fb01606ae256177fef5b35e8943' 
  AND (
    token = 'rorKTO7pl3WXnBAqdW/y/2VBFrRIB/yKhnMSW7waM6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033