UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6q4+tqmJNm8f05e6mVplkSrwnM/oBcEy+v6lAQquXXE=' 
WHERE 
  key_id = '73d07fe1c21a4f3cf43a70b1487e694794141a8cb3142eedb31319f27cbf5582' 
  AND (
    token = '6q4+tqmJNm8f05e6mVplkSrwnM/oBcEy+v6lAQquXXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040